import { createRouter, createWebHistory } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'
// 定义路由组件
const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        name: 'Home',
        component: () => import('@/views/home.vue') // 懒加载组件
    },
    {
        path: '/about',
        name: 'About',
        component: () => import('@/views/about.vue')
    }
]

// 创建路由实例
const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL), // 使用 HTML5 历史模式
    routes
})

export default router